package com.slt.android.customview;

import android.graphics.Color;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {
    Button change;
    CustomViewDraw view;
    CustomTextView tv;
    int count;
    int arry[] = new int[]{Color.RED , Color.BLUE , Color.GREEN , Color.YELLOW};
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_text_custom);
//        tv = (CustomTextView) findViewById(R.id.tv);

//        change = (Button) findViewById(R.id.change);
//        view = (CustomViewDraw) findViewById(R.id.viewDraw);
//        change.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        if(count > 3){
            count=0;
        }
        MyApplication.mCanvas.drawColor(arry[count]);
        count ++;
        view.invalidate();
    }
}
